<?php
include('netpayclient.php');
require ('WebPathSettings.php');
require('./libraries/template.config.php');
$merid=$_POST["merid"];
$orderno=$_POST["orderno"];
$transdate=$_POST["transdate"];
$amount=$_POST["amount"];
$currencycode=$_POST["currencycode"];
$transtype=$_POST["transtype"];
$status=$_POST["status"];
$checkvalue=$_POST["checkvalue"];
$GateId=$_POST["GateId"];
$Priv1=$_POST["Priv1"];
$flag=buildKey("PgPubk.key");
$result = verifyTransResponse($merid, $orderno, $amount, $currencycode, $transdate, $transtype, $status, $checkvalue);
if($result===true){
	$smarty->assign("flag","true");
}else{
	$smarty->assign("flag","false");
}
#$plain = $merid . $orderno . $amount . $currencycode . $transdate . $transtype . $status . $checkvalue;
#$flag  =  verify($plain, $checkvalue);



$smarty->assign("Priv1",$Priv1);
$smarty->assign("GateId",$GateId);
$smarty->assign("checkvalue",$checkvalue);
$smarty->assign("status",$status);
$smarty->assign("transtype",$transtype);
$smarty->assign("currencycode",$currencycode);
$smarty->assign("amount",$amount);
$smarty->assign("transdate",$transdate);
$smarty->assign("orderno",$orderno);
$smarty->assign("merid",$merid);
$smarty->assign("returnstr","支付成功");
$smarty->display('paypgreturn.html');
?>